\(\int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx\) [545]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 59 \[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\left (a^2+b^2\right ) \log (a+b \tan (c+d x))}{b^3 d}-\frac {a \tan (c+d x)}{b^2 d}+\frac {\tan ^2(c+d x)}{2 b d} \]

[Out]

(a^2+b^2)*ln(a+b*tan(d*x+c))/b^3/d-a*tan(d*x+c)/b^2/d+1/2*tan(d*x+c)^2/b/d

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3587, 711} \[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\left (a^2+b^2\right ) \log (a+b \tan (c+d x))}{b^3 d}-\frac {a \tan (c+d x)}{b^2 d}+\frac {\tan ^2(c+d x)}{2 b d} \]

[In]

Int[Sec[c + d*x]^4/(a + b*Tan[c + d*x]),x]

[Out]

((a^2 + b^2)*Log[a + b*Tan[c + d*x]])/(b^3*d) - (a*Tan[c + d*x])/(b^2*d) + Tan[c + d*x]^2/(2*b*d)

Rule 711

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1+\frac {x^2}{b^2}}{a+x} \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = \frac {\text {Subst}\left (\int \left (-\frac {a}{b^2}+\frac {x}{b^2}+\frac {a^2+b^2}{b^2 (a+x)}\right ) \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = \frac {\left (a^2+b^2\right ) \log (a+b \tan (c+d x))}{b^3 d}-\frac {a \tan (c+d x)}{b^2 d}+\frac {\tan ^2(c+d x)}{2 b d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.88 \[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\left (a^2+b^2\right ) \log (a+b \tan (c+d x))-a b \tan (c+d x)+\frac {1}{2} b^2 \tan ^2(c+d x)}{b^3 d} \]

[In]

Integrate[Sec[c + d*x]^4/(a + b*Tan[c + d*x]),x]

[Out]

((a^2 + b^2)*Log[a + b*Tan[c + d*x]] - a*b*Tan[c + d*x] + (b^2*Tan[c + d*x]^2)/2)/(b^3*d)

Maple [A] (verified)

Time = 7.50 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.90

method result size
derivativedivides \(\frac {-\frac {-\frac {b \left (\tan ^{2}\left (d x +c \right )\right )}{2}+a \tan \left (d x +c \right )}{b^{2}}+\frac {\left (a^{2}+b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{3}}}{d}\) \(53\)
default \(\frac {-\frac {-\frac {b \left (\tan ^{2}\left (d x +c \right )\right )}{2}+a \tan \left (d x +c \right )}{b^{2}}+\frac {\left (a^{2}+b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{3}}}{d}\) \(53\)
risch \(\frac {-2 i a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 i a}{b^{2} d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{b^{3} d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) a^{2}}{b^{3} d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{b d}\) \(170\)

[In]

int(sec(d*x+c)^4/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/b^2*(-1/2*b*tan(d*x+c)^2+a*tan(d*x+c))+(a^2+b^2)/b^3*ln(a+b*tan(d*x+c)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 117 vs. \(2 (57) = 114\).

Time = 0.26 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.98 \[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {{\left (a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - {\left (a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (\cos \left (d x + c\right )^{2}\right ) - 2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b^{2}}{2 \, b^{3} d \cos \left (d x + c\right )^{2}} \]

[In]

integrate(sec(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*((a^2 + b^2)*cos(d*x + c)^2*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2) - (a^2
 + b^2)*cos(d*x + c)^2*log(cos(d*x + c)^2) - 2*a*b*cos(d*x + c)*sin(d*x + c) + b^2)/(b^3*d*cos(d*x + c)^2)

Sympy [F]

\[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\int \frac {\sec ^{4}{\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \]

[In]

integrate(sec(d*x+c)**4/(a+b*tan(d*x+c)),x)

[Out]

Integral(sec(c + d*x)**4/(a + b*tan(c + d*x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.62 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.90 \[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {b \tan \left (d x + c\right )^{2} - 2 \, a \tan \left (d x + c\right )}{b^{2}} + \frac {2 \, {\left (a^{2} + b^{2}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{b^{3}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*((b*tan(d*x + c)^2 - 2*a*tan(d*x + c))/b^2 + 2*(a^2 + b^2)*log(b*tan(d*x + c) + a)/b^3)/d

Giac [A] (verification not implemented)

none

Time = 0.38 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.92 \[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {b \tan \left (d x + c\right )^{2} - 2 \, a \tan \left (d x + c\right )}{b^{2}} + \frac {2 \, {\left (a^{2} + b^{2}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{b^{3}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/2*((b*tan(d*x + c)^2 - 2*a*tan(d*x + c))/b^2 + 2*(a^2 + b^2)*log(abs(b*tan(d*x + c) + a))/b^3)/d

Mupad [B] (verification not implemented)

Time = 4.05 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.97 \[ \int \frac {\sec ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,b\,d}+\frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a^2+b^2\right )}{b^3\,d}-\frac {a\,\mathrm {tan}\left (c+d\,x\right )}{b^2\,d} \]

[In]

int(1/(cos(c + d*x)^4*(a + b*tan(c + d*x))),x)

[Out]

tan(c + d*x)^2/(2*b*d) + (log(a + b*tan(c + d*x))*(a^2 + b^2))/(b^3*d) - (a*tan(c + d*x))/(b^2*d)